package net.cathackers.devel.scmp.chat.interfaces;

import net.cathackers.devel.scmp.auth.interfaces.UserID;
import net.cathackers.devel.scmp.chat.exceptions.RosterItemNotFoundException;
import net.cathackers.devel.scmp.chat.impl.xmpp.iqcomponent.roster.RosterItem;
import net.cathackers.devel.scmp.exceptions.BackendException;

public interface RosterSubscriptionManager {

    public enum Subscription {
	NONE("none"),
	FROM("from"),
	TO("to"),
	BOTH("both"),
	REMOVE("remove"); 
	
	private String value_;

	private Subscription(String value) {
		value_ = value;
	}
	public String getStringValue() {
		return value_;      
	}
	
	public String toString(){
	    return super.toString().toLowerCase();
	}
     
    }
    
    public enum Ask {
	SUBSCRIBE("subscribe"),
	UNSUBSCRIBE("unsubscribe"),
	NONE(null);
	private String value_;

	private Ask(String value) {
		value_ = value;
	}
	public String getStringValue() {
		return value_;      
	}
	
	public String toString(){
	    return super.toString().toLowerCase();
	}	
    }
    
    public UserID[] getSubscribers(UserID user) throws RosterItemNotFoundException, BackendException;
    public RosterItem getRosterItem(UserID rosterOwner, UserID contact) throws RosterItemNotFoundException, BackendException ;
    public UserID[] getPublishers(UserID uid) throws BackendException, RosterItemNotFoundException;
    public boolean isASubscriber(UserID ownerID, UserID jid) throws BackendException;
}
